/**
 * thread joinable 判断是否可以 t.join
 */
#include <thread>
#include <iostream>

void hello() {
    std::cout << "Hello Concurrent!" << "\n";
}

int main() {
    std::thread t(hello);
    if (t.joinable()) {
        std::cout << "can join" << std::endl;
    }
    std::cout << "finish 1" << std::endl;
    t.join(); // 阻塞主线程，等待 hello 函数执行
    std::cout << "finish 2" << std::endl;
    return 0;
}